# -*- Python -*-
# Build file for the cudd library by
# Fabio Somenzi, University of Colorado at Boulder
#
# The original website ( http://vlsi.colorado.edu/~fabio ) disappeared.
load("@rules_license//rules:license.bzl", "license")

package(
    default_applicable_licenses = [":license"],
)

# Machine-readable license specification.
license(
    name = "license",
    package_name = "cudd",
    license_kind = "@rules_license//licenses/spdx:BSD-3-Clause",
    license_text = "LICENSE",
)

cc_library(
    name = "cudd",
    srcs = [
        "cudd/cudd.h",
        "cudd/cuddAPI.c",
        "cudd/cuddAddAbs.c",
        "cudd/cuddAddApply.c",
        "cudd/cuddAddFind.c",
        "cudd/cuddAddInv.c",
        "cudd/cuddAddIte.c",
        "cudd/cuddAddNeg.c",
        "cudd/cuddAddWalsh.c",
        "cudd/cuddAndAbs.c",
        "cudd/cuddAnneal.c",
        "cudd/cuddApa.c",
        "cudd/cuddApprox.c",
        "cudd/cuddBddAbs.c",
        "cudd/cuddBddCorr.c",
        "cudd/cuddBddIte.c",
        "cudd/cuddBridge.c",
        "cudd/cuddCache.c",
        "cudd/cuddCheck.c",
        "cudd/cuddClip.c",
        "cudd/cuddCof.c",
        "cudd/cuddCompose.c",
        "cudd/cuddDecomp.c",
        "cudd/cuddEssent.c",
        "cudd/cuddExact.c",
        "cudd/cuddExport.c",
        "cudd/cuddGenCof.c",
        "cudd/cuddGenetic.c",
        "cudd/cuddGroup.c",
        "cudd/cuddHarwell.c",
        "cudd/cuddInit.c",
        "cudd/cuddInt.h",
        "cudd/cuddInteract.c",
        "cudd/cuddLCache.c",
        "cudd/cuddLevelQ.c",
        "cudd/cuddLinear.c",
        "cudd/cuddLiteral.c",
        "cudd/cuddMatMult.c",
        "cudd/cuddPriority.c",
        "cudd/cuddRead.c",
        "cudd/cuddRef.c",
        "cudd/cuddReorder.c",
        "cudd/cuddSat.c",
        "cudd/cuddSign.c",
        "cudd/cuddSolve.c",
        "cudd/cuddSplit.c",
        "cudd/cuddSubsetHB.c",
        "cudd/cuddSubsetSP.c",
        "cudd/cuddSymmetry.c",
        "cudd/cuddTable.c",
        "cudd/cuddUtil.c",
        "cudd/cuddWindow.c",
        "cudd/cuddZddCount.c",
        "cudd/cuddZddFuncs.c",
        "cudd/cuddZddGroup.c",
        "cudd/cuddZddIsop.c",
        "cudd/cuddZddLin.c",
        "cudd/cuddZddMisc.c",
        "cudd/cuddZddPort.c",
        "cudd/cuddZddReord.c",
        "cudd/cuddZddSetop.c",
        "cudd/cuddZddSymm.c",
        "cudd/cuddZddUtil.c",
        "dddmp/dddmp.h",
        "dddmp/dddmpBinary.c",
        "dddmp/dddmpConvert.c",
        "dddmp/dddmpDbg.c",
        "dddmp/dddmpInt.h",
        "dddmp/dddmpLoad.c",
        "dddmp/dddmpLoadCnf.c",
        "dddmp/dddmpNodeAdd.c",
        "dddmp/dddmpNodeBdd.c",
        "dddmp/dddmpNodeCnf.c",
        "dddmp/dddmpStoreAdd.c",
        "dddmp/dddmpStoreBdd.c",
        "dddmp/dddmpStoreCnf.c",
        "dddmp/dddmpStoreMisc.c",
        "dddmp/dddmpUtil.c",
        "epd/epd.c",
        "epd/epd.h",
        "epd/epdInt.h",
        "mtr/mtr.h",
        "mtr/mtrBasic.c",
        "mtr/mtrGroup.c",
        "mtr/mtrInt.h",
        "st/st.c",
        "st/st.h",
        "util/cpu_stats.c",
        "util/cpu_time.c",
        "util/cstringstream.c",
        "util/cstringstream.h",
        "util/datalimit.c",
        "util/pathsearch.c",
        "util/pipefork.c",
        "util/prtime.c",
        "util/safe_mem.c",
        "util/strsav.c",
        "util/texpand.c",
        "util/ucbqsort.c",
        "util/util.h",
    ],
    hdrs = [
        "config.h",
        "cudd/cudd.h",
        "cudd/cuddInt.h",
        "dddmp/dddmp.h",
        "dddmp/dddmpInt.h",
        "epd/epd.h",
        "epd/epdInt.h",
        "mtr/mtr.h",
        "mtr/mtrInt.h",
        "st/st.h",
        "util/cstringstream.h",
        "util/util.h",
    ],
    includes = [
        "./",
        "cudd/",
        "dddmp/",
        "epd/",
        "mtr/",
        "st/",
        "util/",
    ],
    visibility = ["//visibility:public"],
)

cc_library(
    name = "cudd++",
    srcs = ["cplusplus/cuddObj.cc"],
    hdrs = ["cplusplus/cuddObj.hh"],
    copts = ["-fexceptions"],
    features = ["-use_header_modules"],
    visibility = ["//visibility:public"],
    deps = [":cudd"],
)
